package edu.gdkm.demo12;

import java.util.*;

public class ListTest {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        for(int i=0;i<10;i++){
            list.add(new Random().nextInt(100));
        }
        System.out.println(list);
        //集合的工具类
        Collections.sort(list, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        System.out.println(list);

    }

}
